perm filename MAPTST.PAL[HAL,HE]4 blob
sn#200974 filedate 1976-02-10 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00009 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 This is a test program to try out some ideas about the
C00004 00003 Map definitions
C00006 00004 Common area
C00008 00005 COMMON, PINIT, TOSPC
C00013 00006 SWITCH
C00016 00007 DRIVER
C00017 00008 Area zero
C00019 00009 .END
C00020 ENDMK
C⊗;
COMMENT ⊗ This is a test program to try out some ideas about the
proper use of the glorious Panofsky map. We will set up four maps,
each of which shares locations 0 → 17777 and 120000 → 177777. The
locations 20000 → 30000 will be distinct for each of the four maps.
Into each of these areas will be assembled a printing routine (which
will identify which county it is in) and a call to each of the other
county's map routines. Calling an unreachable location will be done
by this code:
MOV #LNAME,-(SP) ;The link name of the routine
JSR PC,SWITCH ;A routine in common space to do it all
The link name is an pointer into the link table. Each entry in that
table is two words. The second is the number of the appropriate
county!951↔∞s⊃βSF)β≠'↔≠Qβ'~βS#∃ε∪∪K/≠Mβ'rβS#π"β∂?Ww#e∨Mπ≠∂#↔n)94U##∃β∨;'S∂BβK?W&K;∃β>K31β↑+↔Aβ'∪π∂-ε{→βSF)βOS∞≠-βπv!β←'faβO↔"βS#∀hSK↔S/∪9βπK↔O~βS=β≡{7↔SFK;≥βNqβ'S≡+3→9αα'Qβ>K31β&C↔K↔6{K∃β∞cO=βF[∀4W#=β≠OAβWAπ##∃β⊗+SWKrq↓XhP1m↓∧kπAβ&+≠';O#'?;_h(4)]βπ∨∃π#π3/_4*B$
A↓j↓EYYβ↓@$%[ AAβ>{K∪Mb↓EβC/⊃βCπ>(4*B$
E↓j↓EYY∪↓@$%[ AAβ>{K∪Mb↓EβC/⊃βCπ>(4*B$
I↓j↓EYY#↓@$%[ AAβ>{K∪Mb↓EβC/⊃βCπ>(4*B$
M↓j↓EYY3↓@$%[ AAβ>{K∪Mb↓EβC/⊃βCπ>(4(4SZCπ∨*βSπf)β↔;'∪'↔MαC↔π∂Bβ?;∃ε3?I↓∪↓AAβ↔KS↔MHh*↑JLrR=↓ki↓EAβ↓A@%]βπ∨∃εCπMβ⊗+↔9β?∪'SS.qβ';&x4*ε≤~⊗N⊃βiu↓↓#↓AA@KZCπ∨*β#πMε∪↔↔9ε∂∂↔∨≠↔⊂4U:JB⊗∀i↓uuα↓IAAβ%nC∞;∃β7∂Iβ∃π;K'S&+9β'w#<4*∀"B⊗Jj↓uu↓β AAAInCπ>)β7πJβ∃β⊗+π⊃β7∪?44U*:&
M!↓uuα↓↓QAβ%o?r↓uyβ.s'W~β?;3Jq↓β?61↓uyε3πOS↔+Mβ?vcd4*∧BNBε:↓uu↓α↓M]]8Io#'>Aβ?K&+IβπK↔O~β'S~β?→βεCgO'≡1βC∞;∀4(hQn7παβOCπ≡)βSπ⊗c∀4*\JNB∞*↓u↓E39AM@HIn/↔⊗s↔1αJβOCπ≡(4*.%~B∞∃βi↓EY;↓I@$KZ/↔Kv+1α⊃π≠Cπ∂(h*N&≥α∞∃↓j↓EY]β→H$%]≠WC↔↔3'O?∩α%βOε∂∀4U~∩NB≤)↓u↓1]AI⊂H%nO/β↔K[O≠?Iα"βOCπ≡(4*:M~B∞∃βi↓EY;↓MP$KZW;W≡+⊃α%π≠Cπ∂(h*:∩≥α∞∃↓j↓EY]β⊃P$%]+;WO.!α⊃β∨βπ∂∀hRV&N∧~∃↓uβ Y]A≠0$%n/≠↔IαJβOCπ≡(4*V%~B∞∃βi↓EY;↓IX$KZWO↔∩α⊃βOε∂∀4Ph)n7∂↓βOC∞≠∃βS∞∪3∃β.sSK'/_4*B$
:=βiu↓E#↓@$%]##∃βε∨∃β&3∃αAAiMJβS=β/≠∃β≠␈⊃βS#O→βOC∞≠∀4*%∩ε:Nα↓uu↓β⊃A@$KYE↓urβ;=βnCC'v84*6E2JB≥βiu↓↓9X$%\kπc'o+5βC∞;∃βSFQβ7∂Iβ∃π∪↔≠↔⊗+;∂↔ h(4)]≠SπS/→βK↔>KOS↔↔_4*N$
RIAβi↓EY;↓A@$KZOSπ'+MβK.;'OS/⊃↓@4PJ6εB,r ↓uj↓EAAβ↓@%m
↓uyβ.sπ3*β7πCεK;≤4Ph(4(1m↓∧≠?77}qβπK.λ4(4Rr&:N∃!α"εdB⊗∩nD
12"-h4):LrNJQ∧YJ∩⊗2rBε2[ E2NM~t4)tJ:NJ"α"ε2Ly:BεeZ"ε1dB⊗t4Ph*6εLr
1hMα∩
2Z↓EAAe_%n7∞[↔Mβ
βCK?≡+OMβ&+O∂KOβS?Iε3?Iβn'9βπ∪?∂↔∨_4(4PJBVRdz
α*|∩∩εQbα6ε&t∩04(MαVR2|→α*>∃~¬1α%∩&Z⊗⊂h(4*e"ε hJr
2.:↓Q@%\+;?W>Aβ≠?∩↓IAβfK;/LhR2"%βP&"%h(%@hR2"%P&"%λh(%DhR2"%∪P&"%⊂h(%HhR2"%≠P&"%_h(%LhP4*∞|j6⊗:"X4*N1βg?*β←π;"βS=β&+≠';*β←#↔⊗)1βO∂I1α~|yβ'Mbβg?Uπ≠#?Wf!β∪=π##'MPh(&B-"2>
∧b~>=bα~><KZS#∃ε∪∪K/≠L4(MαVR2|→α2~|y-I1β⊂%nπ∨≠W7'v9βS#∂!βg?*βπK∃εK9β∂␈+;Seβ⊂4*'2βg?Uπ;π;Qπ#=β∂∞c11β≡e1α4z=1βN{UβOF{W3⊃ε#=βSFKMh4PJ6>Yα~2~>za5"NαH$%n&C'Mβ>K31β>+Qβ∂f+πK↔"β?≠→ph(&*≥⊃αB
e~↑&R≤@$%n>K31β/3↔9β&yβS#*βK↔S/∪9βC⊗{C↔KgH4(XhP1m↓∧~>66|q1αBLr&Q1¬">NB_h(4*≤z66>sP4*∂}k7↔;"YαS∞[↔Mβ&C∃βC∞;∃βS∞∪3∃β∨#πKQε∪∪K/≠Mβ'rαIA↓EαRε βRBRε∪→%84U≠↔SMπ3'KS.1β7.k?Keβ↓5E];9]βπv!↓EIβ↓AA59]]]:βS=β&C∃β↔∂+'[πf+;P4Wβ#gON≠π1βn+7?KJq↓XhP&6>2αII1jBNA$KZOπ[*αIH4PJ6>Yα~V:&∀JQ.↑∃α⊗J5]∩∩B⊗∀i2IDKZCπ∨*βSπf)β↔;'∪d4(Lj>Y↓≠ A2I⊂In;Wn∪↔Iβ}1β↔;'∪'↔Mε3?Iβf{]β∂}k7?9πβπ∨∃π#π3(h*∞>k h&6⎇1αIEbBIA%XInCW"β'9β&C∃β↔w#Kd4PJ&:
¬⊃D$%]≠↔Qβ6{Iβ;/CQβCGKO'∂∞aβCπ>(4(&≤z αI∩b∞>5λInK↔ε+πP4PInIAεKMβ;␈9βO↔"βS=β>{K⊃↓↓1αI
↓5cwto physical page 10.
ADD #100,R0 ;R0 set to word 50 (virt. add. 120000)
ADD #40,R1 ;R1 set to page 50 (phys. add. 120000)
MOV #20,R2 ;Number of entries for mid common page table
COM2: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,COM2 ;Repeat
MOV #UNIBIT+WRPERM+RDPERM+370,R1 ;page 370 (phys. add. 760000)
MOV #10,R2 ;Number of entries for high common page table
COM3: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,COM3 ;Repeat
MOV (SP)+,R2 ;Restore R2
RTS PC ;Done
PINIT:
CLR STATR0 ;Turn off mapping for the nonce
MOV #SWSTCK,PTR ;Initialize the special stack
; Set up the four page tables
MOV #PTAB0,R0 ;Clear all page table entries to start with
MOV #400,R1 ;
PINI0: CLR (R0)+ ;
SOB R1,PINI0 ;
;Page table 0
MOV #PTAB0,R0 ;
JSR PC,COMMON ;
MOV #UNIBIT+WRPERM+RDPERM+10,R1 ;Page table entry
MOV #4,R2 ;Number of entries for the distinct page table
MOV #PTAB0+20,R0;Page table entry
PINI1: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,PINI1 ;Repeat
;Page table 1
MOV #PTAB1,R0 ;
JSR PC,COMMON ;
MOV #UNIBIT+WRPERM+RDPERM+14,R1 ;Page table entry
MOV #4,R2 ;Number of entries for the distinct page table
MOV #PTAB1+20,R0;Page table entry
PINI2: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,PINI2 ;Repeat
;Page table 2
MOV #PTAB2,R0 ;
JSR PC,COMMON ;
MOV #UNIBIT+WRPERM+RDPERM+20,R1 ;Page table entry
MOV #4,R2 ;Number of entries for the distinct page table
MOV #PTAB2+20,R0;Page table entry
PINI3: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,PINI3 ;Repeat
;Page table 3
MOV #PTAB3,R0 ;
JSR PC,COMMON ;
MOV #UNIBIT+WRPERM+RDPERM+24,R1 ;Page table entry
MOV #4,R2 ;Number of entries for the distinct page table
MOV #PTAB3+20,R0;Page table entry
PINI4: MOV R1,(R0)+ ;Put in the entry
INC R1 ;Set for next physical page
SOB R2,PINI4 ;Repeat
;turn it all on, hope it works.
PINI5: CLR R0 ;Set all to map 0
JSR PC,TOSPC ;
MOV #MAPENB,STATR0 ;Turns it on.
RTS PC ;Done
TOSPC: Comment ⊗ R0 has 0, 1, 2, 3. We want to move the user
to that space. Change both the I and D spaces. ⊗
ASH #10,R0 ;
ADD #176,R0 ;Maximum accessible page
MOV R0,KISPCE ;Set the instruction space
MOV R0,KDSPCE ;Set the data space
MOV R0,SISPCE ;Set the instruction space
MOV R0,SDSPCE ;Set the data space
MOV R0,NISPCE ;Set the instruction space
MOV R0,NDSPCE ;Set the data space
MOV R0,UISPCE ;Set the instruction space
MOV R0,UDSPCE ;Set the data space
RTS PC ;Done
; SWITCH
COMMENT ∞ THIS IS THE OLD VERSION
SWITCH:
COMMENT ⊗ The stack holds a pointer into the LTAB. ⊗
MOV R0,-(SP) ;Save R0
MOV R1,-(SP) ;Save R1
MOV PTR,R1 ;The stack for this routine
MOV 4(SP),-(R1) ;Save the return address
MOV UISPCE,-(R1) ;Where we are coming from
MOV 6(SP),-(R1) ;Save the pointer into the LTAB
MOV (R1),R0 ;R0 ← pointer into LTAB
MOV 2(R0),R0 ;R0 ← desired county
JSR PC,TOSPC ;Now we have the right county.
MOV (R1)+,R0 ;R0 ← pointer into LTAB
MOV R1,PTR ;
MOV (R0),TEMP ;Stack the address to jump to
MOV (SP)+,R1 ;Restore R1
MOV (SP)+,R0 ;Restore R0
TST (SP)+ ;Get rid of old return address
TST (SP)+ ;Get rid of the pointer to LTAB
JSR PC,@TEMP ;Jump to the routine, return here
MOV @PTR,UISPCE ;Go back to old space
MOV @PTR,UDSPCE
MOV @PTR,SISPCE
MOV @PTR,SDSPCE
MOV @PTR,KISPCE
MOV @PTR,KDSPCE
ADD #2,PTR ;
MOV @PTR,-(SP) ;The return address
ADD #2,PTR ;
RTS PC ;Return
;∞ END OF OLD VERSION
TEMP: .BLKW 1 ;Variable in SWITCH
PTR: .BLKW 1 ;Variable in SWITCH
.BLKW 100 ;Stack used in SWITCH
SWSTCK: .BLKW 1 ;Top of stack
SWITCH:
MOV R0,-(SP) ;Save R0
MOV 4(SP),R0 ;R0 ← pointer into LTAB
BOUNCE 2(R0),(R0)
MOV (SP)+,R0 ;Restore R0
MOV (SP)+,(SP) ;clear argument to SWITCH
RTS PC
; DRIVER
DRIVER:
JSR PC,PINIT ;
MOV #LHI0,-(SP) ;
JSR PC,SWITCH ;
DISMIS ;
PATCH: .BLKW 100 ;Patch area
; Area zero
.MACRO PLACE PHYS,VIRT
.OFFSET 0
.=PHYS
.OFFSET VIRT-PHYS
.ENDM
HI0:
MOV #MESI0,R0 ;Say hello
JSR PC,TYPSTR ;
MOV #LHI1,-(SP);
JSR PC,SWITCH ;
MOV #MESF0,R0 ;Say goodbye
JSR PC,TYPSTR ;
RTS PC ;Done
MESI0: ASCIE </
INTO AREA ZERO/>
MESF0: ASCIE </
OUT OF AREA ZERO/>
PLACE 30000,20000
HI1:
MOV #MESI1,R0 ;Say hello
JSR PC,TYPSTR ;
MOV #LHI2,-(SP);
JSR PC,SWITCH ;
MOV #MESF1,R0 ;Say goodbye
JSR PC,TYPSTR ;
RTS PC ;Done
MESI1: ASCIE </
INTO AREA ONE/>
MESF1: ASCIE </
OUT OF AREA ONE/>
PLACE 40000,20000
HI2:
MOV #MESI2,R0 ;Say hello
JSR PC,TYPSTR ;
MOV #LHI3,-(SP);
JSR PC,SWITCH ;
MOV #MESF2,R0 ;Say goodbye
JSR PC,TYPSTR ;
RTS PC ;Done
MESI2: ASCIE </
INTO AREA TWO/>
MESF2: ASCIE </
OUT OF AREA TWO/>
PLACE 50000,20000
HI3:
MOV #MESI3,R0 ;Say hello
JSR PC,TYPSTR ;
MOV #MESF3,R0 ;Say goodbye
JSR PC,TYPSTR ;
RTS PC ;Done
MESI3: ASCIE </
INTO AREA THREE/>
MESF3: ASCIE </
OUT OF AREA THREE/>
PUTLOC LHI3, HI3 ;The address
PUTLOC LHI3+2, 3 ;County
.END